<template>
  <div>
    <el-row>
      <el-col :span="24" class="main-title main-v-center">公告栏设置</el-col>
    </el-row>
    <el-row>
      <el-col :span="24" class="main-h-center">
        <el-card style="width:500px;margin-top:30px;" shadow="never">
          <el-input id="foo" type="textarea" :rows="10" v-model="notice"></el-input>
          <el-button @click="handleSet" style="margin:20px 0;float:right;">设 置</el-button>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      notice: ""
    };
  },
  methods: {
    handleSet() {
      this.$http
        .post("/set/update?action=notice", {
          notice: this.notice
        })
        .then(res => {
          if (res.status) {
            this.$message({
              showClose: true,
              message: res.text,
              type: "success"
            });
          } else {
            this.$message.error(res.text);
          }
        });
    }
  },
  computed: {},
  created() {
    this.$http.post("/set/find?action=notice", {}).then(res => {
      this.notice = res.data;
    });
  }
};
</script>
<style scoped>
.head-text {
  float: right;
  color: #99a9bf;
}
</style>


